bitkeeper revision 1.1528 (4292fdfc5zZkxl3RcxrdBZCU6Rd8EA)
authorcl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 24 May 2005 10:12:12 +0000 (10:12 +0000)
committercl349@firebug.cl.cam.ac.uk <cl349@firebug.cl.cam.ac.uk>
Tue, 24 May 2005 10:12:12 +0000 (10:12 +0000)
XendDomain.py:
  Handle error case where exec fails.
xpopen.py:
  Exit with 127 if exec fails.
Signed-off-by: Christian Limpach <Christian.Limpach@cl.cam.ac.uk>
tools/python/xen/util/xpopen.py
tools/python/xen/xend/XendDomain.py

index 78bbefdd2c8d62c49ce6c4124aaceb74656d3a51..b0c880fafe34be140e45fb9f856419ecd73e06a1 100644 (file)
@@ -129,7 +129,7 @@ class xPopen3:
         try:
             os.execvp(cmd[0], cmd)
         finally:
-            os._exit(1)
+            os._exit(127)
 
     def poll(self):
         """Return the exit status of the child process if it has finished,
index 2320e8758d6081dbd27dd590eb0552fd76fe99b0..2df4f48d9777f5649eca3aa545457de408fc7c16 100644 (file)
@@ -392,6 +392,8 @@ class XendDomain:
                 if filter(lambda (fd, event): event & select.POLLHUP, r):
                     break
 
+            if child.wait() >> 8 == 127:
+                lasterr = "popen %s failed" % PATH_XC_RESTORE
             if child.wait() != 0:
                 raise XendError("xc_restore failed: %s" % lasterr)